import service from '../request'

/**
 * 登录
 * @param {*} data 
 * @returns 
 */
export function loginApi(data) {
  return service({
    url: '/user/login',
    method: 'post',
    data
  })
}

export function jsyh(data) {
  return service({
    url: '/system/getAllCorp',
    method: 'post',
    data
  })
}

/**
 * 注册
 * @param {*} data 
 * @returns 
 */
export function registerApi(data) {
  return service({
    url: '/user/register',
    method: 'post',
    data
  })
}

/**
 * 添加用户
 * @param {*} data 
 * @returns 
 */
export function addUserApi(data) {
  return service({
    url: '/user/addUser',
    method: 'post',
    data
  })
}

/**
 * 查询用户信息
 * @param {*} data 
 * @returns 
 */
export function getUserInfoApi(data) {
  return service({
    url: '/user/getUserInfo',
    method: 'post',
    data,
    noNeedLogin: true
  })
}

/**
 * 查询用户信息
 * @param {*} data 
 * @returns 
 */
export function logoutApi(data) {
  return service({
    url: '/user/logout',
    method: 'post',
    data
  })
}
/**
 * 更新用户信息
 * @param {*} data 
 * @returns 
 */
export function updateUserApi(data) {
  return service({
    url: '/user/updateUser',
    method: 'post',
    data
  })
}
/**
 * 删除用户
 * @param {*} data 
 * @returns 
 */
export function deleteUserApi(data) {
  return service({
    url: '/user/delete',
    method: 'post',
    data
  })
}

/**
 * 重置密码
 * @param {*} data 
 * @returns 
 */
export function resetPasswordApi(data) {
  return service({
    url: '/user/resetPassword',
    method: 'post',
    data
  })
}
